package com.budwk.app.sqfw.enums;

import lombok.Getter;

/**
 * 住户信息
 */
@Getter
public enum HouseoldInfoEnum {

    HOUSEHOLD_PERSONNEL_INFO(1, "住户人员信息"),
    RETIRE_PERSONNEL(2, "国有企业退休人员"),
    SIX_KEYNOTE_TABLE_STATIS(3, "六类重点人员分类数据"),
    NINE_TYPES_OF_PERSONNEL_PATROL(4, "九类人员巡查台账"),
    SIX_CATEGORIES_OF_PERSONNEL(5, "六类人员");


    private final Integer code;

    private final String name;

    HouseoldInfoEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * @param code
     * @return
     */
    public static String getName(Integer code) {
        for (HouseoldInfoEnum o : HouseoldInfoEnum.values()) {
            if (o.getCode() == code) {
                return o.getName();
            }
        }
        return null;
    }

    /**
     * @param name
     * @return
     */
    public static Integer getCode(String name) {
        for (HouseoldInfoEnum o : HouseoldInfoEnum.values()) {
            if (o.getName().equals(name)) {
                return o.getCode();
            }
        }
        return null;
    }
}
